package com.woniuxy.main.provider;

import org.apache.ibatis.jdbc.SQL;

import com.woniuxy.main.pojo.Coach;
import com.woniuxy.main.pojo.Student;

public class StudentProvider {

	public String studentUpdate(Student student) {
		SQL sql = new SQL().UPDATE("student").WHERE("uid=" + student.getUid());
		;
		if (student.getSage() != 0) {
			sql.SET("sage=" + student.getSage());
		}
		if (student.getSsex() != null && student.getSsex().length() != 0) {
			sql.SET("ssex='" + student.getSsex() + "'");
		}
		if (student.getSname() != null && student.getSname().length() != 0) {
			sql.SET("sname='" + student.getSname() + "'");
		}

		if (student.getSintroduction() != null && student.getSintroduction().length() != 0) {
			sql.SET("sintroduction='" + student.getSintroduction() + "'");
		}
		// 信息状态有默认值
		sql.SET("publicLevel=" + student.getPublicLevel());
		
		System.out.println("学员的动态sql：" + sql.toString());
		
		return sql.toString();

	}

}
